package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.result.HouseListBean;
import com.common.retrofit.entity.result.SecondHandHouseMapBean;
import com.common.retrofit.service.HaiNingService;

import java.util.ArrayList;

import rx.Observable;
import rx.Subscriber;

public class SecondHouseMapMethods extends BaseMethods {

    private static SecondHouseMapMethods m_ins = null;

    public static SecondHouseMapMethods getInstance() {
        if (m_ins == null) {
            synchronized (SecondHouseMapMethods.class) {
                if (m_ins == null) {
                    m_ins = new SecondHouseMapMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Map/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }

    // 获取首页数据
    public void screen_second_house(Subscriber<ArrayList<SecondHandHouseMapBean>> subscriber, String city_str
            , String area_str , int house_total   , int house_room_num  , int house_floor , int house_renovation  , int house_type   , int house_age
            , int house_certificate
            , int small_price
            , int big_price) {
        Observable observable = initService().map_find_second2(System.currentTimeMillis() + "",
                "dc4b39c40dabe2c78e99122f273b5b2b",city_str,area_str,house_total,house_room_num,house_floor,house_renovation,house_type,house_age,house_certificate,small_price,big_price);
        toSubscribe(observable, subscriber);
    }
}
